/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package contabilidad;

import conexion.CConexion;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

/**
 *
 * @author SISTEMAS
 */
public class CCo101 extends CConexion {

    public CCo101() {
        super();
    }

    public void insertarCuerpo(String ano, String mes, String noas, String noli, String noco, String fech, String codi, String niv1, String niv2, String niv3, String niv4, String niv5, String cec1, String cec2, String cec3, String mone, String tica, String timo, String valn, String vale, String desc, String load) throws SQLException {
        String sql = "INSERT INTO co101(co101nocia,co101ano,co101mes,co101noas,co101noli,co101noco,co101fech,co101codi,co101niv1,co101niv2,co101niv3,co101niv4,co101niv5,co101cec1,co101cec2,co101cec3,co101mone,co101tica,co101timo,co101valn,co101vale,co101desc,co101load,co101fead,co101lomo,co101femo) VALUES('" + login.getCompaniaActual() + "','" + ano + "','" + mes + "','" + noas + "','" + noli + "','" + noco + "','" + fech + "','" + codi + "','" + niv1 + "','" + niv2 + "','" + niv3 + "','" + niv4 + "','" + niv5 + "','" + cec1 + "','" + cec2 + "','" + cec3 + "','" + mone + "','" + tica + "','" + timo + "','" + valn + "','" + vale + "','" + desc + "','" + load + "','" + fech + "','" + load + "','" + fech + "')";
        System.out.println(sql);
        Statement stnc = this.getConexion().createStatement();
        stnc.executeUpdate(sql);
    }
    
     public ResultSet buscar(String ano, String mes, String noas) throws SQLException {
        String sql = "select co101niv1,co101niv2,co101niv3,co101niv4,co101niv5,co101cec1,co101cec2,co101cec3,co101desc,co101valn,co101vale from co101 where co101nocia = '" + login.getCompaniaActual() + "' and co101ano ='" + ano + "' and co101mes = '" + mes + "' and co101noas ='" + noas + "' order by co101valn";
        System.out.println(sql);
        Statement stnc = this.getConexion().createStatement();
        return stnc.executeQuery(sql);
    }
}
